🤖 feat: /btw side-question command + placeholder tip carousel#3293
🤖 feat: /btw side-question command + placeholder tip carousel#3293ammar-agent wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 430261a29b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… carousel Address review feedback on PR #3293: - Render /btw as a single visually-distinct Q/A block: continuous left stripe joins the user question (compact, no bubble, 'Side question' header) and the assistant answer (mt-0 to tuck flush). Reads as one side-branch rather than two adjacent decorations. - Suspend main-agent chat events while a /btw answer streams. While isSideQuestionStreaming() is true, events targeting other messages buffer in sideQuestionEventBuffer and replay on side stream-end. The main agent visually picks up *after* the aside instead of having concurrent tokens shove the side branch around (root cause of the layout flashes). - Side-question pipeline now emits the placeholder MuxMessage envelope before stream-start so the side-question-answer marker reaches the frontend aggregator first. handleStreamStart carries the marker forward across its fresh-envelope construction so both the badge and the suspension layer see it for the full stream. - Remove dismiss button + workspace.dismissSideQuestion RPC + tests. Hard-delete UX wasn't worth the complexity; users can leave the pair in place since the suspension layer keeps them visually contained. - Tip carousel switches to a wall-clock 20-minute bucket so switching workspaces inside the same bucket never reshuffles the visible tip. Drop the now-unused useWorkspaceUserMessageCount hook and the tautological tests (lead-with, length cap, format regex) the reviewer flagged. --- _Generated with `mux` • Model: `anthropic:claude-opus-4-7` • Thinking: `high` • Cost: \0.95_ <!-- mux-attribution: model=anthropic:claude-opus-4-7 thinking=high costs=30.95 -->
|
@codex review Substantial follow-up: the /btw UX moved from "inline pair with dismiss" to a single visually-distinct Q/A block, and the main chat now suspends while a side question streams so concurrent main-agent tokens can't shove the side branch around (root cause of the prior layout flashes). The tip carousel is also rebucketed onto a wall-clock 20-min rotation so switching workspaces inside the same bucket no longer reshuffles the visible tip. PR body refreshed accordingly. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbec371282
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8e87b45f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 124a72a496
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the latest P2 findings:
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55e4a0b9ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the latest P2: side-question answer streams still render through Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec56bacd94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the buffered replay issue: side-question stream starts are now ignored (not reset) in the pending active-stream fallback, so an in-flight main stream remains interruptible/working during hydration even if Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 021fc904d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the context reset issue: Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b1c975e80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the transcript cap issue: Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a96df87a95
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the live stream context issue: Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16c30edd11
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the live stream snapshot race: Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8ecc4611b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the pre-candidate race: Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ba9f11fa2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the live partial duplication issue: when a live main stream snapshot is merged into the Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aece1b3b19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the latest findings and the reported bottom-sticking behavior:
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bede969e17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Updated /btw scroll handling after the streaming-order fix: side questions now anchor at the interruption point immediately and release bottom-lock once main output appears below the side branch, so the user can read the aside before opting back into the live tail. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b4bf1881b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
95eed46 to
b25c489
Compare
|
@codex review Rebased onto latest main and force-pushed the side-question scroll/model/composer fixes after local validation passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b25c48949f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b25c489 to
850448e
Compare
|
@codex review Fixed the post-rebase command gating conflict, re-ran local static-check, and force-pushed the corrected branch. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 850448e956
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
850448e to
ac3b820
Compare
|
@codex review Addressed the new fallback-model and side-question edit findings, with focused regression tests, then re-ran local targeted tests and |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac3b820c9f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ac3b820 to
deb0f34
Compare
|
@codex review Preserved side-question answer metadata on stream-end replay, added coverage for the terminal metadata, and re-ran focused tests plus |
deb0f34 to
a93d3fb
Compare
|
@codex review Updated active-stream selection to ignore /btw side-answer streams for interrupt/live usage/stats callers, added regression coverage for side-answer-first ordering, and re-ran focused tests plus |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a93d3fbe3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a93d3fb to
e8cfc02
Compare
|
@codex review Updated caught-up buffered stream classification to use the historical-message-aware side-answer detector, re-ran workspace /btw tests, focused side-question regressions, and |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
… carousel Address review feedback on PR #3293: - Render /btw as a single visually-distinct Q/A block: continuous left stripe joins the user question (compact, no bubble, 'Side question' header) and the assistant answer (mt-0 to tuck flush). Reads as one side-branch rather than two adjacent decorations. - Suspend main-agent chat events while a /btw answer streams. While isSideQuestionStreaming() is true, events targeting other messages buffer in sideQuestionEventBuffer and replay on side stream-end. The main agent visually picks up *after* the aside instead of having concurrent tokens shove the side branch around (root cause of the layout flashes). - Side-question pipeline now emits the placeholder MuxMessage envelope before stream-start so the side-question-answer marker reaches the frontend aggregator first. handleStreamStart carries the marker forward across its fresh-envelope construction so both the badge and the suspension layer see it for the full stream. - Remove dismiss button + workspace.dismissSideQuestion RPC + tests. Hard-delete UX wasn't worth the complexity; users can leave the pair in place since the suspension layer keeps them visually contained. - Tip carousel switches to a wall-clock 20-minute bucket so switching workspaces inside the same bucket never reshuffles the visible tip. Drop the now-unused useWorkspaceUserMessageCount hook and the tautological tests (lead-with, length cap, format regex) the reviewer flagged. --- _Generated with `mux` • Model: `anthropic:claude-opus-4-7` • Thinking: `high` • Cost: \0.95_ <!-- mux-attribution: model=anthropic:claude-opus-4-7 thinking=high costs=30.95 -->
e8cfc02 to
064d6b0
Compare
|
@codex review Rebased on latest main and force-pushed after |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 064d6b08f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
064d6b0 to
b339b3a
Compare
|
@codex review Addressed the side-answer stream-start pending-startup regression and the zero-offset non-text split regression with focused tests; |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b339b3ac54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b339b3a to
599e39b
Compare
|
@codex review Addressed the side-answer terminal handling: main completions are final even while /btw streams overlap, and side-answer stream-end no longer clears pending main startup. Added focused regressions and |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
599e39b to
bc0356c
Compare
|
@codex review Rebased onto latest main and squashed the branch to a single commit. Local targeted tests and |
Summary
Adds the
/btwslash command — a forked, single-turn, read-only side-question over the current conversation. Tools are denied on both the prompt and schema sides; the question and answer are persisted to chat history with distinct metadata and stream through the existingTypewriterMarkdownpath so the side branch reads as one offset Q/A cycle in the transcript. Also adds a placeholder tip carousel that surfaces/btw(and other slash-command tricks) on a wall-clock rotation, making the new command passively discoverable without flashing across workspace switches.Background
/btwis modeled on Claude Code 2.1.73's command of the same name: a quick "by the way, what was that file you mentioned?" question that runs against the current transcript without invoking tools and without re-anchoring the main agent loop. The persistence/UX iterated through three rounds (overlay → inline pair with dismiss button → single Q/A block with main-chat suspension) based on review feedback before settling on the current shape.Implementation
Backend (
src/node/services/sideQuestionService.ts)<system-reminder>that explicitly tells the model tools are unavailable; callsstreamTextwith notoolsargument so the no-tools contract is enforced on both prompt and schema sides.historyServiceallocates a realhistorySequence), emits it as amessagechat event so the frontend aggregator sees theside-question-answermuxMetadata before stream-start, then drivesstream-start/stream-delta/stream-endthroughsession.emitChatEvent. The frontend'sStreamingMessageAggregatorhandles these identically to a real agent stream —TypewriterMarkdown, smooth-text animation, and replay all just work.updateHistoryfills the placeholder with the streamed text; prior/btwexchanges are filtered out of each new side question's transcript so the model never grounds on its own earlier (possibly wrong) answers.Frontend: Q/A block + suspension
/btwuser question renders as a bare block (no bubble, no right-alignment, no per-row meta) with a compact "Side question" header. The assistant answer tucks flush beneath it (mt-0) and both rows share the same continuous left accent stripe, so the pair reads as one offset side branch rather than two adjacent message rows.WorkspaceStore.processStreamEventconsultsaggregator.isSideQuestionStreaming()and buffers any chat event that targets a different message while a/btwanswer is in flight. On the side-question's terminal event the buffer drains in arrival order, so main-agent text picks up after the aside instead of streaming concurrently underneath it. This is what fixes the layout flashes from the previous iteration.handleStreamStartcarries forward existingmuxMetadatawhen constructing the fresh streaming envelope, so theside-question-answermarker survives the stream-start → stream-end window in both the live and replay paths.workspace.dismissSideQuestionRPC + tests are removed — hard-delete UX wasn't worth the complexity now that the suspension layer keeps the pair visually contained.Placeholder tip carousel
floor(Date.now() / 20min) % tips.length). Same bucket → same tip everywhere, so switching workspaces inside the same bucket never reshuffles the placeholder./btw <question>. Mobile keeps the plain "Type a message..." placeholder.useWorkspaceUserMessageCounthook from the previous iteration was removed.Validation
New tests cover the load-bearing behavioral contracts:
StreamingMessageAggregator.sideQuestion.test.ts):isSideQuestionAnswerMessagediscriminates by storedmuxMetadata,isSideQuestionStreamingflips while a side stream is active, and the marker is preserved acrosshandleStreamStart(regression coverage for the muxMetadata carry-forward).WorkspaceStore.test.ts→ "/btw side-question suspension"): main-agentstream-deltaevents that arrive while a/btwanswer is streaming are buffered (main text stays put), the side-answer's own deltas bypass suspension, and the buffer drains on sidestream-endso the main message picks up where it left off.sideQuestionService.test.ts): the placeholder envelope is emitted before stream-start with the correctside-question-answermuxMetadata, the full event sequence ismessage→message(placeholder) →stream-start→ N ×stream-delta→stream-end, no tools are passed tostreamText, prior side-question turns are filtered from the transcript, and empty answers short-circuit cleanly.placeholderTips.test.ts): rewritten to test only behavior — same tip throughout a bucket, advances on bucket boundary, wraps past the end, and defensive fallback for non-finite inputs. The tautological "leads with /btw", "has between 1 and 11 tips", and "every tip references a slash command" tests called out in review were removed.make typecheck,make lint, andmake static-checkall pass locally.Risks
Concentrated in two places:
WorkspaceStore.processStreamEventnow consultsaggregator.isSideQuestionStreaming()on every event before dispatching. The check is O(active streams) (almost always 1) and bypasses entirely when no/btwis running. Worst-case failure mode would be main-agent events getting stuck in the buffer if a/btwterminal event never fires; the buffer is cleared on workspace removal, but a long-lived "stuck" side stream would block the main agent. In practice the side-question service always emits a terminal event (thetry/catcharoundstreamTextfalls through to an emptystream-end).streamMessagepipeline./btwemits stream events throughsession.emitChatEventdirectly, so the workspace'sstreamingflag, idle-compaction recency, and post-compaction attachments all skip/btw. This is intentional product behavior, but worth a careful eye onStreamingMessageAggregatorinteractions if anything feels off.Discoverability (future)
The tip carousel is tier-1. Right-click → "Ask /btw about this", a selection action chip, an onboarding slide, and a "did you mean /btw?" heuristic can land independently.
Generated with
mux• Model:anthropic:claude-opus-4-7• Thinking:high• Cost:$30.95